package com.lintesis.lintesismodel.common.hibernate;

import org.jasypt.encryption.pbe.PBEByteEncryptor;
import org.jasypt.encryption.pbe.StandardPBEByteEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.hibernate.encryptor.HibernatePBEEncryptorRegistry;


public class JasyptInitializer {
	public static void init() {
		
		String password="bostdencriptor2010";


		StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
		strongEncryptor.setPassword(password);
		
		PBEByteEncryptor binaryEncryptor=new StandardPBEByteEncryptor();
		binaryEncryptor.setPassword(password);

		
		HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry
		.getInstance();
		registry.registerPBEStringEncryptor("hibernateStringEncryptor",
				strongEncryptor);
		registry.registerPBEByteEncryptor("hibernateByteArrayEncryptor", binaryEncryptor);
		

	}
}
